<style>
    input:out-of-range
    {
        border:2px solid red;
    }
</style>
<input type="number" min="5" max="10" value="17" />